#ifndef Error_First
#define Error_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Types.h"
#include "ET_varargs.h"

const int
	cWarning  =   0,
	cError    =   1000,
	cSysError =   2000,
	cFatal    =   3000;
		
typedef void (*ErrorHandlerFunc)(int level, bool abort, const char *location,
																const char *msg);

extern void ErrorHandler(int level, const char *location, const char *fmt,
																	va_list va);
extern void AbstractMethod(const char*);
extern void MayNotUse(const char*);

// All these functions are written in C++, but I want them
// to have C linkage so I can call them from my C code.
extern "C" {
	void Error(const char *location, const char *msgfmt, ...);
	void SysError(const char *location, const char *msgfmt, ...);
	void Warning(const char *location, const char *msgfmt, ...);
	void Fatal(const char *location, const char *msgfmt, ...);
}

extern void DefaultErrorHandler(int level, bool abort, const char *location,
															const char *msg);

ErrorHandlerFunc SetErrorHandler(ErrorHandlerFunc newhandler);
ErrorHandlerFunc GetErrorHandler();

int SetAssertLevel(int l);
int GetAssertLevel();

#endif
